Query processing with multiple distinct aggregates, cube, rollup, and grouping sets can include maintaining separate streams of groupings and then performing operations, such as group by, join, etc., on the streams to generate query results. The number of streams and the number of group by or join operations are proportional, for example, to the number of distinct aggregates in the query. This results in increased memory usage and thus increased expense as the number of distinct operations to respond to a query increases. This can further result in a distributed deadlock.